package cc.cc4414.webservice.webservice;

import javax.xml.ws.Endpoint;

import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author cc 2018年10月31日
 */
@Configuration
public class WebserviceConfig {
	@Autowired
	private Bus bus;

	@Autowired
	private ApiWebservice apiWebservice;

	@Bean
	public Endpoint endpoint() {
		EndpointImpl endpoint = new EndpointImpl(bus, apiWebservice);
		endpoint.publish("/api");
		return endpoint;
	}
}
